<div id="sub_nav">
      <p>Quick Links:</p>
      <ul>
        <li><a href="javascript:void(0);" controller="users" action="add"
            title="Add" onclick='showPop(this)'>Add New Q-Admin</a></li>
       
      </ul>
    </div>
<div class="breadcrumb">
    <ul id="breadcrumb">
        <li><a href="<?php echo Configure::read('base_url');?>backstage" title="Home">
		<?php echo $this->Html->image("home.png", array("alt" => "Home",'class'=>'home','border'=>'0'));?>
		</a></li>
        <li><a href="<?php echo Configure::read('base_url');?>backstage/users" title="Manage Admin">Manage Q-Admin</a></li>
        
    </ul>
</div>
<?php echo $this->element('admin/admin_leftmenu'); ?>
<div id="left"> 
    <?php
    echo $this->Session->flash();
    if ($this->Session->check('Message.auth'))
        echo $this->Session->flash('auth');
    ?>
    <div class="div_header"><?php __('Manage Q-Admin'); ?></div>
    <div class="div_content">
           <table id="category_table" cellspacing="0" class="tablesorter">
            <thead>
                <tr>
                    <th width="50" ><?php echo _('id'); ?></th>
                    <th width="120" ><?php echo _('Username'); ?></th>
                    <th width="120" ><?php echo _('Name'); ?></th>
                    <th width="120" ><?php echo _('Email'); ?></th>
                    <th width="70" >Actions</th>

                </tr>
            </thead>
            <tbody>
                <?php
                $i = 0;
                //pr($users);
                foreach ($users as $user):
                    $class = null;
                    if ($i++ % 2 == 0) :
                        $class = ' class="alt"';
                ?>
                        <tr>
                            <td class="alt"><?php echo $i; ?></td>
                            <td class="alt"><a href="<?php echo Configure::read('base_url');?>backstage/users/qadmin_summary/<?php echo $user['User']['id'];?>">
                            <?php echo $user['User']['username']; ?>
                            </a>
                            </td>
                            <td class="alt">
<?php echo $user['User']['first_name'];echo' ';echo $user['User']['last_name']; ?>
                    </td>
                    <td class="alt"><?php echo $user['User']['email']; ?></td>
                    <td align="center" class="alt">
                       <?php echo $html->link('Contact Admin',array('backstage' => true, 'controller' => 'messages', 'action' => 'new_message',$user['User']['id']), array()); ?>
                       &nbsp;&nbsp;
                        <a href="javascript:void(0);" controller="users" action="edit" title="Edit" ElmID="<?php echo $user['User']['id']; ?>" onclick='showPop(this)'>
<?php echo $this->Html->image("edit_gray.png", array("alt" => "Edit", 'border' => '0')); ?>
                        </a>&nbsp;&nbsp;
                        <?php
                        echo $this->Html->link(
                                $this->Html->image("delete_gray.png", array("alt" => "Delete", 'border' => '0')),
                                array('action' => 'delete', $user['User']['id']),
                                array('escape' => false), sprintf(__('Are you sure you want to delete %s?', true), $user['User']['username'])
                        );
                        ?>
                    </td>
                </tr>
				<?php else: ?>
                <tr>
                    <td><?php echo $i; ?></td>
                    <td><a href="<?php echo Configure::read('base_url');?>backstage/users/qadmin_summary/<?php echo $user['User']['id'];?>"> <?php echo $user['User']['username']; ?></a></td>
                    <td>
					<?php echo $user['User']['first_name'];echo' ';echo $user['User']['last_name']; ?>
                    </td>
                    <td><?php echo $user['User']['email']; ?></td>
                    <td align="center">
                        <?php echo $html->link('Contact Admin',array('backstage' => true, 'controller' => 'messages', 'action' => 'new_message',$user['User']['id']), array()); ?>
                        &nbsp;&nbsp;
                        <a href="javascript:void(0);" controller="users" action="edit" title="Edit" ElmID="<?php echo $user['User']['id']; ?>" onclick='showPop(this)'>
<?php echo $this->Html->image("edit_yellow.png", array("alt" => "Edit", 'border' => '0')); ?>
                        </a>&nbsp;&nbsp;
                        <?php
                        echo $this->Html->link(
                                $this->Html->image("delete_red.png", array("alt" => "Delete", 'border' => '0')),
                                array('action' => 'delete', $user['User']['id']),
                                array('escape' => false), sprintf(__('Do you really want to suspend the Q-Admin?', true))
                        );
                        ?>
                    </td>

                </tr>
				<?php endif;endforeach;?>
                    <tbody>
                </table>
       
            </div>
            <div class="div_bottom"></div>
        </div>

        <!-- edit sidebar items here -->

<!--        </div>-->

<?php echo $html->script(array("jquery.pagination.js", "jquery.tablesorter.min.js", "jquery.tablednd.js")); ?>
<script type="text/javascript"> 
    jQuery(document).ready(function(){
        jQuery("#category_table").tablesorter({headers: {4:{sorter: false}, 5:{sorter: false}}});
    });
</script>